package com.db.stockexchange.client;

/**
 * 
 * @author Rayman
 * Type of stock operation
 */
public enum StockOperation {
	SELL(0), BUY(1);
	
	private StockOperation(int index) {
		
	}
	
	public static StockOperation byIndex(int index) {
		switch(index) {
		case 0:return StockOperation.SELL;
		case 1:return StockOperation.BUY;
		default:
			throw new IllegalArgumentException("Index of stock operation is illegal");
		}
	}
}
